/* pages/message/message.wxss */
.message-container {
  height: 100vh;
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
}

.page-header {
  background-color: #ffffff;
  padding: 20rpx 30rpx;
  border-bottom: 1rpx solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333333;
}

.swipe-hint {
  font-size: 24rpx;
  color: #999999;
}

.message-scroll {
  flex: 1;
  height: calc(100vh - 60rpx);
  position: fixed; 
  margin-top: 90rpx;
}

.message-list {
  padding: 20rpx 0;
}

.swipe-item {
  position: relative;
  overflow: hidden;
}

.message-card {
  background-color: #ffffff;
  margin: 0 20rpx 20rpx 20rpx;
  padding: 20rpx;
  border-radius: 16rpx;
  display: flex;
  align-items: center;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

/* 移除固定的swipe-open样式，改用动态transform */

.message-card:active {
  transform: scale(0.98);
  box-shadow: 0 1rpx 4rpx rgba(0, 0, 0, 0.1);
}

.user-avatar-box {
  width: 100rpx;
  height: 100rpx;
  margin-right: 20rpx;
  flex-shrink: 0;
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #f0f0f0;
}

.message-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8rpx;
}

.user-name {
  font-size: 32rpx;
  font-weight: bold;
  color: #333333;
  flex: 1;
}

.message-time {
  font-size: 24rpx;
  color: #999999;
  margin-left: 10rpx;
}

.message-content {
  font-size: 28rpx;
  color: #666666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.message-badge {
  position: absolute;
  top: 20rpx;
  right: 20rpx;
  background-color: #ff4757;
  border-radius: 20rpx;
  min-width: 40rpx;
  height: 40rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-text {
  font-size: 20rpx;
  color: #ffffff;
  font-weight: bold;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400rpx;
  color: #999999;
}

.empty-icon {
  font-size: 120rpx;
  margin-bottom: 20rpx;
}

.empty-text {
  font-size: 28rpx;
}

/* 删除按钮样式 - 修复显示问题 */
.delete-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 120rpx;
  background-color: #ff4757;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border-radius: 0 16rpx 16rpx 0;
  /* 默认情况下隐藏在右侧 */
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

/* 当左滑时显示删除按钮 */
.swipe-item.swipe-open .delete-btn {
  transform: translateX(0);
}

.delete-text {
  color: #ffffff;
  font-size: 28rpx;
  font-weight: bold;
}
